/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.scanner.helper;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

/** 
 * @title AnnotationHelper.java  
 * @package com.hyts.apidoc.scanner.help  
 * @description TODO  
 * @see TODO
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年4月20日 
 * @version V1.0 
 */
public final class AnnotationHelper {

	/**  
	 * <b>isContainAnnotation</b>
	 * <p>是否包含注解</p>
	 * @param scanClazz
	 * @param annotationClazz
	 * @return boolean 是否包含注解
	 * @exception
	 */ 
	public static boolean isContainAnnotation(Class scanClazz,Class annotationClazz) {
		return scanClazz.isAnnotationPresent(annotationClazz);
	}
	
	/**  
	 * <b>getAnnotationByField</b>
	 * <p>获取所有定义Field字段上的注解</p>
	 * @param scanClazz
	 * @param annotationClazz
	 * @return Annotation[]
	 * @exception 
	 */ 
	public static Annotation[] getAnnotationByField(Class scanClazz,Class annotationClazz) {
		Field[] fields = scanClazz.getClass().getDeclaredFields();
		for(Field field : fields) {
			field.getAnnotation(annotationClazz);
		}	
		return null;
	}
	
	/**  
	 * <b>TODO(方法功能的描述)</b>
	 * <p>TODO(这里用一句话描述这个方法的作用)</p>
	 * @param scanClazz
	 * @param annotationClazz
	 * @return
	 * @exception
	 */ 
	public static Annotation[] getAnnotationByMethod(Class scanClazz,Class annotationClazz) {
		return null;
	}
	
	/**  
	 * <b>TODO(方法功能的描述)</b>
	 * <p>TODO(这里用一句话描述这个方法的作用)</p>
	 * @param scanClazz
	 * @param annotationClazz
	 * @return
	 * @exception
	 */ 
	public static Annotation[] getAnnotationByType(Class scanClazz,Class annotationClazz) {
		return null;
	}
	
	
}
